namespace BusinessObjectsReport
{
    using System;
    using System.Collections.Generic;
    using Telerik.Reporting;

    /// <summary>
    /// Summary description for Report1.
    /// </summary>
    public partial class BusinessObjectsReport : Report
    {
        public BusinessObjectsReport()
        {
            /// <summary>
            /// Required for telerik Reporting designer support
            /// </summary>
            InitializeComponent();
            BookStore bookStore = new BookStore(20);
            this.DataSource = bookStore.Books;
        }
    }
    
    /// <summary>
    /// BookStore
    /// </summary>
    class BookStore
    {
        List<Book> books = new List<Book>();

        public BookStore(int bookCount)
        {
            for (int i = 0; i < bookCount; i++)
            {
                this.books.Add(new Book());
            }
        }

        public List<Book> Books
        {
            get { return books; }
        }
    }

    /// <summary>
    /// Book
    /// </summary>
    class Book
    {
        static Random random = new Random();
        int year = random.Next(1900, 2008);
        Author author = new Author();

        public int Year
        {
            get { return this.year; }
        }

        public Author Author
        {
            get { return this.author; }
        }
    }

    /// <summary>
    /// Author
    /// </summary>
    class Author
    {
        static Random random = new Random();
        static string[] names = new string[]{"John"
            , "Paul"
            , "George"
            , "Elizabeth"
            , "Andrew"};
        static string[] families = new string[]{"Smith"
            , "Jones"
            , "Williams"
            , "Brown"
            , "Taylor"};

        string name;

        public Author()
        {
            this.name = string.Format("{0} {1}"
                , names[random.Next(0, 5)]
                , families[random.Next(0, 5)]);
        }

        public string Name
        {
            get { return this.name; }
        }
    }
}